package com.netease.xone.adapter;

import protocol.meta.UserAdvice;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;

import com.netease.framework.widget.LinkedListAdapter;
import com.netease.xone.R;
import com.netease.xone.itemview.RenderAdviceView;


public class AdviceAdapter extends LinkedListAdapter<UserAdvice> {

    private Context mContext;

    public AdviceAdapter(Context context ) {
        mContext = context;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        if(convertView == null){
            convertView = View.inflate(mContext, R.layout.view_advice_list_item, null);
            RenderAdviceView render = new RenderAdviceView(convertView);
            convertView.setTag(render);
        }
        RenderAdviceView render = (RenderAdviceView)convertView.getTag();
        render.renderView(mContext, getItem(position));
        return convertView;
    }


}
